<%--
  Created by IntelliJ IDEA.
  User: 12904
  Date: 2018/8/9
  Time: 19:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<html>

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->


    <script src="js/jquery-1.12.4.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $.post("indexServlet","", show,"json");

            function show(data) {
                $(".message").children().remove();
                $(data).each(function () {
                    $(".message").append("<tr>"
                        + "<td>" + this.uid + "</td>"
                        + "<td>" + this.ulist[0].uname + "</td>"
                        + "<td>" + this.ulist[0].usex + "</td>"
                        + "<td>" + this.ulist[0].uphone + "</td>"
                        + "<td>" + this.ulist[0].uaddress + "</td>"
                        + "<td>" + this.ulist[0].uemail + "</td>"
                        + "<td>" + this.drank + "</td>"
                        + "<td>" + this.rlist[3].areaName + "</td>"

                        + "<td class='td-manage'>"
                        + "<a onclick='member_stop(this,'10001')' href='javascript:;'  title='启用'>"
                        + "<i class='layui-icon'>&#xe601;</i>"
                        + "</a>"
                        + "<a title='编辑'  onclick='x_admin_show('编辑','admin-edit.html')' href='javascript:;'>"
                        + "<i class='layui-icon'>&#xe642;</i>"
                        + "</a>"
                        + "<a title='删除'><i class='layui-icon'>&#xe640;</i>"
                        + "</a>"
                        + "</td>"

                        + "</tr>");
                })





                $(".prev").click(function () {
                    var flag = -1;
                    $.post("indexServlet", {"flag": flag}, show, "json");
                });

                $(".next").click(function () {
                    var flag = 1;
                    $.post("indexServlet", {"flag": flag}, show, "json");
                })

//                var $tr;
//                $("[title=删除]").click(function () {
//                    $tr = $(this).parent().parent();
//                    var id = $tr.children().get(1).textContent;
//                    $.post("delServlet", {"id": id}, function (data) {
//                        if (data > 0) {
//                            alert("删除成功!");
//                            $tr.remove();
//                        } else {
//                            alert("删除失败!");
//                        }
//                    })
//                })


            }


        })

    </script>

</head>

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>导航元素</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12  layui-form-pane">
            <div class="layui-form-item" id="x-city">
                <label class="layui-form-label">请选择所属地区</label>
                <div class="layui-input-inline">
                    <select name="province" lay-filter="province">
                        <option value="">请选择省</option>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="city" lay-filter="city">
                        <option value="">请选择市</option>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="area" lay-filter="area">
                        <option value="">请选择县/区</option>
                    </select>
                </div>
                <input class="layui-btn" type="submit" value="查询"> </input>
            </div>
        </form>
        <xblock>
            <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
            <button class="layui-btn" onclick="x_admin_show('添加代理','./agency_info1.jsp')"><i class="layui-icon"></i>添加</button>
        </xblock>


    </div>





    <table class="layui-table">
        <thead>
        <tr>
            <td>ID</td>
            <td>姓名</td>
            <td>性别</td>
            <td>手机号码</td>
            <td>地址</td>
            <td>邮箱</td>
            <td>级别</td>
            <td>代理的区域</td>
            <td>操作</td>

        </tr>
        </thead>
        <tbody class="message">

        </tbody>
    </table>
    <div class="page">
        <div>
            <a class="prev" href="#">&lt;&lt;</a>

            <a class="next" href="#">&gt;&gt;</a>
        </div>
    </div>

</div>

<script type="text/javascript" src="./js/xcity.js"></script>
<script>
    layui.use(['form','code'], function(){
        form = layui.form;

        layui.code();

//        默认地址是 湖南 长沙市 开福区
        $('#x-city').xcity('湖南','长沙市','开福区');

    });
</script>
<script>
    var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>

</html>
